package com.tbvtc.agriculturalcreditchainserver2025.exception;

//import com.atguigu.lease.common.result.ResultCodeEnum;
import com.tbvtc.agriculturalcreditchainserver2025.utils.ResultCodeEnum;
import lombok.Data;

@Data
public class FoodException extends RuntimeException {
    private Integer code;

    public FoodException(Integer code, String message) {
        super(message);
        this.code = code;
    }
    public FoodException(ResultCodeEnum resultCodeEnum) {

        super( resultCodeEnum.getMessage()); // 异常信息
        this.code = resultCodeEnum.getCode(); // 异常代码
    }
//    public leaseException(ResultCodeEnum resultCodeEnum) {
//
//        super( resultCodeEnum.getMessage()); // 异常信息
//        this.code = resultCodeEnum.getCode(); // 异常代码
//    }
}
